home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 18009 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: news.sprintlink.net!datalytics!usenet
  2. From: Rob Stewart <stew@datalytics.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Edit box & SetWindowText?
  5. Date: Thu, 18 Apr 1996 10:34:29 -0400
  6. Organization: Datalytics, Inc
  7. Message-ID: <317652F5.66CA@datalytics.com>
  8. References: <2c4_9604160250@csource.blaze.net.au>
  9. NNTP-Posting-Host: 204.62.224.71
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (WinNT; I)
  14.  
  15. Edward Connor wrote:
  16. > Hi All
  17. > Why are things never as straight forward as they appear they can/should be?
  18. > Or is it me???
  19. > I create an edit box as the book, my bible, shows me (ie: Teach Yourself
  20. > Windows Programming in 21 Days) using CreateWindow(...). [Day 10]
  21. > Then I insert text into it using SetWindowText(...)
  22. > According to the book this "is a fairly simple process" which it is, but,
  23. > the carriage returns do not initiate new lines. Instead all I get in the
  24. > edit box instead of a carriage return is a small vertical line.
  25. > I have discovered that if I add a new line thing '\n' to the cr thing '\r'
  26. > then there will occur a new line break in the script, but this is not a
  27. > very efficient way to go about things. I have experimented with all the
  28. > ES_... and WS_... things in the construction of the edit box, but to no
  29. > avail.
  30. > There must be a 'proper' way to do it, but????
  31. > Thanks to any one who can assist
  32.  
  33. We've found that we need \n\r as well.  Apparently, \n is 
  34. translated into a linefeed only.  \r is just a carriage return, 
  35. not a return and a linefeed.  By contrast, the Enter key 
  36. normally issues a carriage return/linefeed pair.  \r is 
  37. analogous to moving the platten on a mechanical typewriter to 
  38. return the left side.  A linefeed (\n in this case) is analogous 
  39. to rolling the platten to the next line.  The Enter key, then, 
  40. is analogous to hitting the lever that moves the platten back to 
  41. the left side and rolls the platten to the next line all at 
  42. once.
  43.  
  44. -- 
  45. Robert Stewart        | My opinions are usually my own.
  46. Datalytics, Inc.    | stew@datalytics.com
  47.